﻿#include "RenderMaterial.h"

#include "Render/Texture/RenderTexture2D.h"   
#include "Render/Texture/RenderTextureCube.h"
#include "Render/Material/RenderShader.h"


void CRenderMaterial::SetAllMaterialThings(std::shared_ptr<CRenderShader> InVertexShader, std::shared_ptr<CRenderShader> InFragmentShader, bool InDoubleSide, ERenderMaterialType InMaterialType, const TVector<float> &InParameters, const TVector<std::shared_ptr<CRenderTexture2D>> &InTexture2Ds, const TVector<std::shared_ptr<CRenderTextureCube>> &InTextureCubes)
{
    std::lock_guard<std::mutex> LockGuard(Mutex);
    VertexShader=InVertexShader;
    FragmentShader=InFragmentShader;
    bDoubleSided=InDoubleSide;
    Type=InMaterialType;
    Parameters=InParameters;
    Texture2Ds=InTexture2Ds;
    TextureCubes=InTextureCubes;
}

void CRenderMaterial::SetParameters(const TVector<float> &InParameters, const TVector<std::shared_ptr<CRenderTexture2D>> &InTexture2Ds, const TVector<std::shared_ptr<CRenderTextureCube>> &InTextureCubes)
{
    std::lock_guard<std::mutex> LockGuard(Mutex);
    Parameters=InParameters;
    Texture2Ds=InTexture2Ds;
    TextureCubes=InTextureCubes;

}
